<?php
/**
 * @Author: liuhongbin
 * @Email: 514660094@qq.com
 * @Date: 2019-02-12 16:15:10
 * @Description:
 * @LastEditors: liuhongbin
 * @LastEditTime: xxx
 */

namespace app\adminapi\controller\v1\platform\douyin;


use app\adminapi\controller\v1\platform\PlatformController;
use app\common\controller\AdminController;
use app\common\model\wechat\WechatUser as WechatUserModel;
use think\App;

class DouyinUser extends PlatformController
{

    /**
     * @var WechatUserModel
     */
    private $model;

    public function __construct(App $app)
    {
        parent::__construct($app);
        $this->model = new WechatUserModel();
    }

    /**
     * 显示资源列表
     * @Route("WechatUser", method="GET")
     * @return \think\Response
     */
    public function index()
    {
        $data = $this->model->getPageListModel()->scope('hasPlaid')
//            ->hasWhere('wallet')
            ->append(['wallet', 'fAddon', 'lAddon', 'topUser','teamUser', 'relation_type_name'])
            ->hidden(['unionid'])
            ->select();
        $count = $this->model->getPageListModel([], false)->hasWhere('wallet')->count();
        return $this->success($count, $data);
    }
}
